<%--
  Created by IntelliJ IDEA.
  User: cos
  Date: 2022/6/9
  Time: 15:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
</head>
<body>
    <button id="btn1">get</button>
    <button id="btn2">post</button>
    <button id="btn3">put</button>
    <button id="btn4">delete</button>
    <hr>
    <div id="msg"></div>
    <script>
        $(function () {
                $("#btn1").click(function () {
                    $.ajax({
                        type:"get",
                        url:"/rest/user",
                        success:function (result) {
                            $("#msg").text(result);
                        }
                    })
                })
                $("#btn2").click(function () {
                    $.ajax({
                        type:"post",
                        url:"/rest/user",
                        success:function (result) {
                            $("#msg").text(result);
                        }
                    })
                })
                $("#btn3").click(function () {
                    $.ajax({
                        type:"put",
                        url:"/rest/user",
                        success:function (result) {
                            $("#msg").text(result);
                        }
                    })
                })
                $("#btn4").click(function () {
                    $.ajax({
                        type:"delete",
                        url:"/rest/user/2333",
                        success:function (result) {
                            $("#msg").text(result);
                        }
                    })
                })
        })
    </script>
</body>
</html>
